*******************************************************************************************
***CLASSROOMS OR CRACKDOWNS? HOW VIOLENCE AFFECTS SECURITY POLICY PREFERENCES IN MEXICO***
***Authors: Sarah Berens, Ana I. López García, Barry Maydom*******************************
******************************************************************************************

***********************************
**SUPPLEMENTARY MATERIAL - TABLES**
***********************************
*1.Balance Checks
*2. Summary Statistics
**2.1 Summary Statistics
**2.2 Correlation Matrix
*3. Regression Tables
**3.1 Full sample (controls)
**3.2 Full sample (alternative estimations)
*4. Subgroup analysis
**4.1 Crime
*****4.1. Extorsion
**4.2 Fear 
*****Changed behaviour 
*****Expenses in security protection measures
*****Moving intentions due to fear 
*****Perceptions of unsafety in neighbourhood / state / country
*****Evaluations of the security situation
**4.3 State abuse 
*****Knows someone who experienced state abuse by police
*****Knows someone who paid a bribe to a police officer
*****How easy is it to bribe police officers

********************************************************
use "Data ready E4-E5.dta", clear 

********************************************************
*1.BALANCE CHECKS
tabulate E5_vign1 E5_vign2, summarize(E5_crime_measures)

*Balance tests - Territorial manipulation (vign 1)
iebaltab E5_crime_measures female age_groups1 age_groups2 age_groups3 age_groups4 age_groups5 edlevel1 edlevel2 edlevel3 ///
	edlevel4 college_higher income_cat1 income_cat2 income_cat3 employed, grpvar(E5_vign1) save("TableA4.xlsx") ///
	replace starl(0.05 0.010 0.001) rowvarlabels 

*Balance tests - Preventative / punitive approach manipulation (vign 2)
iebaltab E5_crime_measures female age_groups1 age_groups2 age_groups3 age_groups4 age_groups5 edlevel1 edlevel2 edlevel3 ///
	edlevel4 college_higher income_cat1 income_cat2 income_cat3 employed, grpvar(E5_vign2) save("TableA5.xlsx") ///
	replace starl(0.05 0.010 0.001) rowvarlabels 

********************************************************
*2. DATA DESCRIPTION
*2.1 Summary Statistics
set matsize 10000 

sum2docx E5_crime_measures  female female age_groups1 age_groups2 age_groups3 age_groups4 age_groups5 edlevel1 edlevel2 edlevel3 ///
	edlevel4 college_higher income_cat1 income_cat2 income_cat3 employed informal good_house_economy good_country_economy ///
	income_perceptions* migrant remittances self_placement* incumbent indigenous religiosity crime_victim victim* crime_fear ///
	unsafe_state police_abuse crime_state vigilantes_neigh police_bribe   using "TableA1.docx", replace stats(N mean sd min median max) ///
	title("Table A1: Descriptive statistics – Respondents’ characteristics") 

*2.2 Correlation matrix
asdoc pwcorr crime_victim victim2 victim3 unsafe_state crime_fear police_abuse vigilantes_neigh police_bribe, label ///
	save(TableA2.doc) replace sig setstars(***@.001, **@.01, *@.05)

*2.3 Cross-tabs 
outreg2 police_abuse crime_victim using "TableA3.xls", replace cross excel noaster noparen
outreg2 unsafe_state crime_victim using "TableA3a.xls", replace cross excel noaster noparen
outreg2 police_abuse unsafe_state using "TableA3b.xls", replace cross excel noaster noparen
 

****************************************************
*3. REGRESSION TABLES
****************************************************
***TABLE A6 
***3.1 Full sample (controls)
*OLS regression with basic controls
reg E5_crime_measures i.E5_vign2 i.E5_vign1
outreg2 using "Table_A6.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label title ("Table A6: OLS regression: Support for increased police") 

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A6.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2##i.E5_vign1
outreg2 using "Table_A6.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2##i.E5_vign1 i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A6.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 


****TABLE A7
***3.2 Full sample (alternative estimations) 
reg E5_crime_measures i.E5_vign2 i.E5_vign1 
outreg2 using "Table_A7.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A7: OLS, oprobit and ologit regression: Support to increased state security presence")

*probit regression with effect coding variables
oprobit E5_crime_measures i.E5_vign2 i.E5_vign1 
outreg2 using "Table_A7.xls", append ctitle(probit) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

*logit regression with effect coding variables
ologit E5_crime_measures i.E5_vign2 i.E5_vign1 
outreg2 using "Table_A7.xls", append ctitle(logit) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

	
***TABLE A8
**3.3 OLS regression - additional controlS
	
reg E5_crime_measures i.E5_vign2 i.E5_vign1
outreg2 using "Table_A8.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label title ("Table A8: OLS regression: Perceptions of police effectiveness") 

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A8.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 
	
reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.good_house_economy i.good_country_economy
outreg2 using "Table_A8.xls", append ctitle(ols + economic assessments) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.enough_income
outreg2 using "Table_A8.xls", append ctitle(ols + economic difficulties) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.ideology
outreg2 using "Table_A8.xls", append ctitle(ols + ideology) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.incumbent
outreg2 using "Table_A8.xls", append ctitle(ols + incumbent) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed c.bribe_officers_index
outreg2 using "Table_A8.xls", append ctitle(ols + distrust in security officers) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +)

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed c.religiosity
outreg2 using "Table_A8.xls", append ctitle(ols + religiousity) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.indigenous
outreg2 using "Table_A8.xls", append ctitle(ols + ethnicity) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.state
outreg2 using "Table_A8.xls", append ctitle(ols + state fe) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) 


***********************************************************
*4. SUBGROUPS 
*4.1 Subroups - CRIME VICTIMIZATION
*OLS regression with effect coding variables
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.violence_victim i.E5_vign2#i.violence_victim i.E5_vign1#i.violence_victim
outreg2 using "Table_A9.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A9: OLS regression: Support to increased state security presence, by crime victimization")

reg E5_crime_measures i.E5_vign2 i.E5_vign1  i.violence_victim i.E5_vign2#i.violence_victim i.E5_vign1#i.violence_victim i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A9.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

***********************************************************
**4.2 Subroups - UNSAFE STATE 
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.unsafe_state i.E5_vign2#i.unsafe_state i.E5_vign1#i.unsafe_state
outreg2 using "Table_A10.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A10: OLS regression: Support to increased state security presence, by perceptions of insecurity in the state")

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.unsafe_state i.E5_vign2#i.unsafe_state i.E5_vign1#i.unsafe_state i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A10.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

	
***********************************************************
**4.2 Subroups - CHANGED BEHAVIOUR DUE TO FEAR 
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.crime_fear i.E5_vign2#i.crime_fear i.E5_vign1#i.crime_fear
outreg2 using "Table_A11.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A11: OLS regression: Support to increased state security presence, by changed behaviour due to crime")

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.crime_fear i.E5_vign2#i.crime_fear i.E5_vign1#i.crime_fear i.E5_vign1  i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A11.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label

***********************************************************
*4.2 Subroups - VIGILANTES/WATCHGROUPS IN NEIGHBOORHOOD
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.vigilantes_neigh i.E5_vign2#i.vigilantes_neigh i.E5_vign1#i.vigilantes_neigh
outreg2 using "Table_A12.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A12: OLS regression: Support to increased state security presence, by security groups in neighboorhoos")

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.vigilantes_neigh i.E5_vign2#i.vigilantes_neigh i.E5_vign1#i.vigilantes_neigh i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A12.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

************************************************************
**4.3 Subgroups - STATE ABUSE
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.police_abuse i.E5_vign2#i.police_abuse i.E5_vign1#i.police_abuse
outreg2 using "Table_A13.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A13: OLS regression: Support to increased state security presence, by abuse by state security officers")

reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.police_abuse i.E5_vign2#i.police_abuse i.E5_vign1#i.police_abuse i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A13.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 

************************************************************
**4.3 Subroups - DOUBLE VICTIMIZATION
reg E5_crime_measures i.E5_vign2 i.E5_vign1 i.crime_state i.E5_vign2#i.crime_state i.E5_vign1#i.crime_state
outreg2 using "Table_A14.xls", replace ctitle(ols) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label ///
	title ("Table A14: OLS regression: Support to increased state security presence, by abuse by state security officers")

rreg E5_crime_measures i.E5_vign2 i.E5_vign1 i.crime_state i.E5_vign2#i.crime_state i.E5_vign1#i.crime_state i.female i.age_range i.education_cat i.income_level i.employed i.migrant
outreg2 using "Table_A14.xls", append ctitle(ols + controls) excel dec(3) alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, +) ///
	addnote("Source: Mexico Pollfish Survey 2021/22") see label 


